package homework_05.home_01;

import java.util.Scanner;

public class HomeWork_01 {
    /*1.    编写一个方法，求整数n的阶乘，例如5的阶乘是1*2*3*4*5。*/
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("输入n:");
        int a = input.nextInt();
        System.out.println(jiecheng(a));
    }
    public static int jiecheng(int n){
        int sum=1;
        for (;n>1;n--){
            sum*=n;
        }
        return sum;
    }
}